This is the LIBMAD library, ported and optimized for the ESP8266 by
Earle F. Philhower, III <earlephilhower@yahoo.com>.  The entire GIT
history is preserved in GitHub at:
    https://github.com/earlephilhower/libmad-8266

Unlike the "port" in NONOS-SDK from Espressif, this works in STEREO
with an external I2S, or a full dynamic 32x oversampled mono using
the AudioOutputI2SNoDAC which sounds poretty good @ 44.1KHz.

The only functional changes made were in the synth section, where the
amount of data synthesized in one pass was reduces from 1156 to 32 bytes
and pre-scaled to minimize memory usage.  Most other work involved
shrinking the HEAP footprint by moving any constants to PROGMEM and
adjusting the code to work.  Often shorts could just be made to ints
and then pointer/array access "just worked."  In other cases accessor
functions or macros were required to make the mad_fixed_t accesses
use a 32-bit read before operating on a local register/RAM copy of
a value.

Massive stack variables were moved to the heap and dynamically
allocated/deallocated on function entrance/exit.  The xr[] array
and the tmp[] array in layer3.c took around 8KB stack space, whereas
the standard Arduino only has 4K total stack.  That lead to some very
interesting crashes, believe you me.

Present memory needs to decode 128kb/sec MP3s are around 34KB heap
and 1KB stack.  Of this, about 24KB are required at all times once
the MP3 object is instantiated, while the additional 10KB are for the
stack-to-heap variables mentioned above.

Any bugs in the port are most likely my fault, not Underbit's.  I'd
like to thank them for producing such a readable MP3 decoder and
releasing it under the GPL.  Their web page is:
  http://www.underbit.com/products/mad/

-Earle F. Philhower, III
 earlephilhower@yahoo.com
